package com.luckberry.murder.service.impl;

import com.luckberry.murder.entity.Script;
import com.luckberry.murder.mapper.ScriptMapper;
import com.luckberry.murder.service.ScriptService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class ScriptServiceImpl implements ScriptService {

    @Resource
    private ScriptMapper mapper;

    @Override
    public List<Script> getScripts() {
        return mapper.getScripts();
    }

    @Override
    public List<Script> getScriptsByName(String name) {
        return mapper.getScriptsByName(name);
    }

    @Override
    public Script getScript(int sid) {
        return mapper.getScript(sid);
    }

    @Override
    public boolean addScript(Script script) {
        return mapper.addScript(script) == 1;
    }

    @Override
    public boolean deleteScript(int sid) {
        return mapper.deleteScript(sid) == 1;
    }

    @Override
    public boolean editScript(Script script) {
        return mapper.editScript(script) == 1;
    }
}
